import {modules} from "../../engines/gameEngine";

const {ccclass, property} = cc._decorator;

@ccclass
export default class VersionNotice extends cc.Component {

    @property(cc.Label)
    lbNotice: cc.Label = null;
    @property(cc.Node)
    detail: cc.Node = null;
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start() {
        //
        this.onShow();
    }

    private m_scaleTime: number = 0.3;


    onShow(cb?: () => void) {
        modules().uiControlModule.showHideDialogAnimation(this.detail, true);
    }

    onHide(cb?: () => void) {
        modules().uiControlModule.showHideDialogAnimation(this.detail, false, cb);
    }

    setNotice(notice: string) {
        this.lbNotice.string = notice;
    }

    onBtnClose() {
        this.onHide(() => {
            this.node.destroy();
        })
    }

    // update (dt) {}
}
